<!doctype html>
<title>Timer object</title>

<script>

var timer =
{ 
  start: function()
  {
    var self = this;
    window.setInterval(function(){self.tick();}, 1000); 
  },
  tick: function()
  {
    console.log("tick!");
  }
};

timer.start();

</script>

